<?php

include "../WGM/config.php";

include "../WGM/core/classes/class.sql.php";
include "../WGM/core/classes/class.user.php";

include "../WGM/core/library/lib.droits.php";

include "../WGM/modules/ident_phpbb/main.php";

include "../WGM/modules/menus/classes/class.menu.php";

$sql= new sql();

ident_init();
$GLOBALS["USER"]=unserialize($_SESSION["user"]);

$str="<div id='menu'>";
$res=$sql->request("select * from ".CFG_MYSQL_PREFIX."menu order by ordre");
foreach($res as $var){
	$menu=new menu($var);
	if($menu->module==""){
		if($menu->get_titre()=="Forum") $str.="<a href='".$menu->lien."' class='selected'>".$menu->get_titre()."</a>";
		else $str.="<a href='".$menu->lien."'>".$menu->get_titre()."</a>";
	}elseif(($menu->module!="")&&(user_droit($menu->module))){
		$str.="<a href='".CFG_REP_INSTALL.$menu->module."'>".$menu->get_titre()."</a>";
	}
}
$str.="</div>";

echo $str;